<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp" %>    
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>左边上级菜单</title>
<meta name="decorator" content="default" />

</head>

<body>
	<div class="boxcontent">
		<div id="content" class="content">
			<div id="left" class="l-left-small">
				<div class="tnav">
				</div>
			</div>
			<div id="openClose" class="close" style="height: 566.6px;">&nbsp;</div>
			<div id="right" class="l-right-big">
				<iframe name="thirdcontent" id="contentMain" src="" frameborder="false" scrolling="auto" style="border:none;" width="100%" height="470" allowtransparency="true">
				</iframe>
			</div>
			<div class="clear"></div>
		</div>
	</div>
	<jsp:include page="/WEB-INF/views/include/pageJs.jsp" />
	<script>
		$(function(){
			//三级导航与右侧iframe高度调整
			var rhight,lheight;
			$("#contentMain").on("load",function () {
				var sonHeight = $(this).contents().find(".boxcontent").height();
			
				if(sonHeight > 566.6){
					$(this).height(sonHeight);
					$(".l-right-big").height(sonHeight);
				    $(".l-left-small").css("height",sonHeight+2+"px");
				  	//子页面iframe加载完毕后调整父iframe的高度
				    $("#contentMain",window.parent.document).height(sonHeight+40);
				}
				else{
					$(this).height(566.6);
					$(".l-right-big").height(566.6);
				    $(".l-left-small").css("height",566.6+"px");
				  	//子页面iframe加载完毕后调整父iframe的高度
				    $("#contentMain",window.parent.document).height(590);
				}
				
			});
			
			$(function(){
				 var hiddens=$("#mainFrame",window.parent.document).parents("body").find(".cnav").find(".current");
				 loadthirdmenu1(hiddens);
			})
			
			//初始化的时候加载三级菜单
		    function loadthirdmenu1(event){
		    	var urls=$(event).find("input[type=hidden]");
		    	if(urls.length==0)return false;
		    	$(".tnav").empty();
		    	$.each(urls,function(index,event1){
		    		var select=index==0?'class="select"':'';
		    		var current = index == 0?'class="current"':'';
		    		var html='<div class="linenav"><a href="'+$(event1).attr("data-url")+'" '+select+' target="thirdcontent">'+$(event1).attr("data-name")+'<i '+current+'></i></a></div>';
		    		$(".tnav").append(html);
		    	});
		    	
		    	$(".tnav").find("a").bind("click",function(){
		    		loading('正在加载中...');
		    		$(this).addClass("select");
		    		$(this).children("i").addClass("current");
					$(this).parents("div").siblings().find("a").removeClass("select").children("i").removeClass("current");
		    	});
		    	
		    	var span=$(event).find("span");
				if(span.length==0)return false;
				$("#contentMain").attr("src",$(span[1]).attr("data-url"));
		    }
			
		});
		
		var leftWidth = 179; // 左侧窗口大小
		//var htmlObj = $("html"), mainObj = $("#main");
		//var frameObj = $("#left, #openClose, #right, #right iframe");
		function wSize(){
			
			if($("#openClose").hasClass("close")){
				$("#right").css("margin-left","188px");
				$("#openClose").css("background-position-x","0px");
			}else{
				$("#right").css("margin-left","8px");
				$("#openClose").css("background-position-x","-29px");
			}
		}
	</script>
	
	<script src="${ctxStatic}/common/wsize.js" type="text/javascript"></script>
</body>
</html>